package com.wing.cabinet.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wing.bill.model.response.MaterialCheckStatisticsVO;
import com.wing.cabinet.model.entity.CheckedResult;
import com.wing.cabinet.model.response.CheckedResultVO;
import com.wing.cabinet.model.response.CheckedScrapVO;
import com.wing.cabinet.model.response.InspectionAndRepairExportVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 盘验结果表-Dao
 *
 * @author
 */
@Mapper
public interface CheckedResultDao extends BaseMapper<CheckedResult> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<CheckedResultVO> list4app(@Param("params") Map<String, Object> params);

    List<CheckedScrapVO> getCheckedScrapVoExportList (@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<CheckedResultVO> list4app(@Param("page") Page<CheckedResultVO> page, @Param("params") Map<String, Object> params);

    List<InspectionAndRepairExportVO> getInspectionAndRepairExportVOList(@Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    CheckedResultVO get4appById(Long id);

    int updateIsGenOrder(@Param("idList") List<Long> idList);

    List<HashMap> getCabCodeGroupBy(@Param("page") Page<HashMap> page,@Param("cabCode") String cabCode,@Param("belongCabinet") String belongCabinet);

    List<HashMap> getStatisticsByCabCode(@Param("cabCode") String cabCode);

    List<HashMap> getDetailStatisticsByCabCode(@Param("cabCode") String cabCode,@Param("spaceCode") Integer spaceCode,@Param("businessType") Integer businessType);

    List<HashMap> getTaskGroupBy(@Param("page") Page<HashMap> page,@Param("taskCode") String taskCode,@Param("cabCode") String cabCode);

    /**
     * 物料盘验统计（按天）顶部折线图
     * @param params
     * @return
     */
    List<HashMap> topLineChart(@Param("params") Map<String, Object> params);

    /**
     * 物料盘验数据统计
     * @param params
     * @return
     */
    MaterialCheckStatisticsVO materialCheckStatistics(@Param("params") Map<String, Object> params);

    /**
     * 物料盘验结果（按物料）柱状图
     * @param params
     * @return
     */
    List<HashMap> materialCheckResult(@Param("params") Map<String, Object> params);

    /**
     * 物料盘验排名（按柜子）饼状图
     * @param params
     * @return
     */
    List<HashMap> materialCheckRankingPieChart(@Param("params") Map<String, Object> params);
}
